package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import com.changgou.goods.pojo.Category;
import com.changgou.goods.pojo.Template;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/****
 * @Author:传智播客
 * @Description:Category的Dao
 * @Date 2019/6/14 0:12
 *****/
public interface CategoryMapper extends Mapper<Category> {


    /**
     * 查询分类分类
     * @param parentId
     * @return
     */
    @Select("select * from tb_category where parent_id=#{parentId}")
    List<Category> findCateGoryParentId(@Param(value = "parentId") Integer parentId);

    /**
     *      根据信息分类查询  查询商品
     * @param categoryId
     * @return
     */
    @Select("select tb.* from tb_brand tb, tb_category_brand tcb where tb.id = tcb.brand_id and tcb.category_id = 76")
    List<Brand> findCategoryBrandById(Integer categoryId);



}
